import request from '@/utils/request'

// 首页
export function crmContractIndex(data) {
  return request({
    url: 'contract/index',
    method: 'post',
    data: data
  })
}


// 新增
export function crmContractSave(data) {
  return request({
    url: 'contract/save',
    method: 'post',
    data: data
  })
}


// 修改
export function crmContractUpdate(data) {
  return request({
    url: 'contract/update',
    method: 'post',
    data: data
  })
}

// 删除
export function crmContractDel(data) {
  return request({
    url: 'contract/delete',
    method: 'post',
    data: data
  })
}

// 详情
export function crmContractRead(data) {
  return request({
    url: 'contract/read',
    method: 'post',
    data: data
  })
}

// 记录
export function crmContractActionRecord(data) {
  return request({
    url: 'contract/actionrecord',
    method: 'post',
    data: data
  })
}

// 日志
export function crmContractLogIndex(data) {
  return request({
    url: 'contract/servicelogindex',
    method: 'post',
    data: data
  })
}

// 日志
export function crmContractLogList(data) {
  return request({
    url: 'contract/loglist',
    method: 'post',
    data: data
  })
}

// 日志新增
export function crmContractLogSave(data) {
  return request({
    url: 'contract/save_log',
    method: 'post',
    data: data
  })
}


// 日志修改
export function crmContractLogUpdate(data) {
  return request({
    url: 'contract/update_log',
    method: 'post',
    data: data
  })
}

// 日志删除
export function crmContractLogDel(data) {
  return request({
    url: 'contract/del_log',
    method: 'post',
    data: data
  })
}

// 财务信息
export function crmContractFinancelist(data) {
  return request({
    url: 'contract/financelist',
    method: 'post',
    data: data
  })
}

// 财务信息-新增未收款
export function crmContractNoFinanceSave(data) {
  return request({
    url: 'contract/save_nofinance',
    method: 'post',
    data: data
  })
}

// 财务信息-修改未收款
export function crmContractNoFinanceUpdate(data) {
  return request({
    url: 'contract/update_nofinance',
    method: 'post',
    data: data
  })
}

// 财务信息-删除未收款
export function crmContractNoFinanceDel(data) {
  return request({
    url: 'contract/del_nofinance',
    method: 'post',
    data: data
  })
}

// 财务信息-新建收款
export function crmContractFinanceSave(data) {
  return request({
    url: 'contract/save_finance',
    method: 'post',
    data: data
  })
}

// 财务信息-修改收款
export function crmContractFinanceUpdate(data) {
  return request({
    url: 'contract/update_finance',
    method: 'post',
    data: data
  })
}

// 财务信息-删除收款
export function crmContractFinanceDel(data) {
  return request({
    url: 'contract/del_finance',
    method: 'post',
    data: data
  })
}

// 财务信息-审核收款
export function crmContractFinanceConfirm(data) {
  return request({
    url: 'contract/confirm_finance',
    method: 'post',
    data: data
  })
}


// 财务信息-新增开票
export function crmContractInvoiceSave(data) {
  return request({
    url: 'contract/save_invoice',
    method: 'post',
    data: data
  })
}

// 财务信息-修改开票
export function crmContractInvoiceUpdate(data) {
  return request({
    url: 'contract/update_invoice',
    method: 'post',
    data: data
  })
}

// 财务信息-删除开票
export function crmContractInvoiceDel(data) {
  return request({
    url: 'contract/del_invoice',
    method: 'post',
    data: data
  })
}

// 服务统计
export function crmContractServiceStatistics(data) {
  return request({
    url: 'contract/service_statistics',
    method: 'post',
    data: data
  })
}

// 获取状态
export function crmContractStatusGet(data) {
  return request({
    url: 'contract/getstatus',
    method: 'post',
    data: data
  })
}


// 客户反馈
export function crmContractcomplainIndex(data) {
  return request({
    url: 'contract/contractcomplainindex',
    method: 'post',
    data: data
  })
}

// 客户反馈
export function crmContractcomplainList(data) {
  return request({
    url: 'contract/contractcomplainlist',
    method: 'post',
    data: data
  })
}

// 客户反馈新增
export function crmContractcomplainSave(data) {
  return request({
    url: 'contract/save_contractcomplain',
    method: 'post',
    data: data
  })
}

// 客户反馈修改
export function crmContractcomplainUpdate(data) {
  return request({
    url: 'contract/update_contractcomplain',
    method: 'post',
    data: data
  })
}

// 客户反馈删除
export function crmContractcomplainDel(data) {
  return request({
    url: 'contract/del_contractcomplain',
    method: 'post',
    data: data
  })
}


// 停止服务
export function crmContractClose(data) {
  return request({
    url: 'contract/close',
    method: 'post',
    data: data
  })
}


/**
 * 导出
 * @param {*} data
 * customer_id 客户ID
 */
export function crmContractExcelExport(data) {
  return request({
    url: 'contract/excelexport',
    method: 'post',
    data: data,
    responseType: 'blob',
    timeout: 600000
  })
}